import { UserConfig } from 'vite'
import path from 'path'

const pathResolve = (pathStr: string) => {
  return path.resolve(__dirname, pathStr)
}

const config: UserConfig = {
  port: 8080,
  alias: {
    '/@/': pathResolve('./src')
  },
  proxy: {
    '/boss': {
      target: 'http://eduboss.lagou.com',
      changeOrigin: true // 把请求头中的 host 配置为 target
    },
    '/front': {
      target: 'http://edufront.lagou.com',
      changeOrigin: true
    }
  },
  optimizeDeps: {
    include: ['element-plus/lib/locale/lang/zh-cn']
  }
}

module.exports = config
